//
//  Memory Save Operation.h
//  Memento 2.0
//
//  Created by Chris Maddocks on 2010-07-18
//  Copyright 2010 Team Memento. All rights reserved.
//
//  See http://developer.apple.com/iphone/library/documentation/General/Conceptual/ConcurrencyProgrammingGuide/OperationObjects/OperationObjects.html#//apple_ref/doc/uid/TP40008091-CH101-SW6
//
//  Description: This class represents a concurrent operation that saves a memory image to disk.  By saving
//  a memory to disk concurrently, we allow the user to continue interacting with Memento while the image is
//  being saved (a 3-4 second operation on an iPhone 3GS).

#import <Foundation/Foundation.h>
#import "Memory.h"
#import "ImageHelpers.h"

@interface MemorySaveOperation : NSOperation {
	BOOL        executing;
    BOOL        finished;
	
	NSString	*filePath;
	UIImage		*image;	
	Memory		*memory;
}
@property (nonatomic, copy) NSString *filePath;
@property (nonatomic, retain) UIImage *image;
@property (nonatomic, retain) Memory *memory;

- (id)initForMemory:(Memory *)aMemory withImage:(UIImage *)aImage toFilePath:(NSString *)aFilePath;
- (void)completeOperation;

UIImage *UIImageScaledToSize(UIImage *image, CGSize toSize);

@end

